﻿using Common;

namespace Entity
{
    public partial class EntityManager
    {
        private sealed class ShowEntityInfo : IReference
        {
            /// <summary>
            /// 序列化 Id
            /// </summary>
            private int m_SerialId;
            /// <summary>
            /// 实体 Id
            /// </summary>
            private int m_EntityId;
            /// <summary>
            /// 实体组
            /// </summary>
            private IEntityGroup m_EntityGroup;
            /// <summary>
            /// 用户自定义数据
            /// </summary>
            private object m_UserData;


            public ShowEntityInfo()
            {
                m_SerialId = 0;
                m_EntityId = 0;
                m_EntityGroup = null;
                m_UserData = null;
            }


            public int SerialId
            {
                get
                {
                    return m_SerialId;
                }
            }

            public int EntityId
            {
                get
                {
                    return m_EntityId;
                }
            }
            
            public IEntityGroup EntityGroup
            {
                get
                {
                    return m_EntityGroup;
                }
            }
            
            public object UserData
            {
                get
                {
                    return m_UserData;
                }
            }


            public static ShowEntityInfo Create(int serialId, int entityId, IEntityGroup entityGroup, object userData)
            {
                ShowEntityInfo showEntityInfo = ReferencePool.Acquire<ShowEntityInfo>();
                showEntityInfo.m_SerialId = serialId;
                showEntityInfo.m_EntityId = entityId;
                showEntityInfo.m_EntityGroup = entityGroup;
                showEntityInfo.m_UserData = userData;
                return showEntityInfo;
            }



            public void Clear()
            {
                m_SerialId = 0;
                m_EntityId = 0;
                m_EntityGroup = null;
                m_UserData = null;
            }
        }
    }
}